﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;

namespace PBDesk.Web.Main.UI.Controls.Rambling
{
    public partial class Footer : PBDesk.Framework.WebUI.BaseUserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            StringBuilder sb = new StringBuilder();
            CreateFooterMenuItem(ref sb, "Home", "/");
            CreateFooterMenuItem(ref sb, "Tech News & Articles", "/UI/Art/Default.aspx");
            CreateFooterMenuItem(ref sb, "My Projects", "/UI/Projs/Default.aspx");
            CreateFooterMenuItem(ref sb, "Tools & Utils", "/UI/TU/Default.aspx");
            CreateFooterMenuItem(ref sb, "Blogs", "/UI/Blogs/Default.aspx");
            CreateFooterMenuItem(ref sb, "About Me", "/UI/Gen/AboutMe.aspx");
            CreateFooterMenuItem(ref sb, "Disclaimer", "/UI/Gen/Disclaimer.aspx", true);
            footerMenuDiv.InnerHtml = sb.ToString();

        }

        private void CreateFooterMenuItem(ref StringBuilder sb, string itemName, string url, bool isLast = false)
        {
            string format = "<a href=\"{0}\"> {1}</a> {2}";
            string delimiter = isLast ? string.Empty : " | ";
            sb.AppendFormat(format, url, itemName, delimiter);
        }
    }
}